Magic Sets vs. SLD-Resolution

نویسنده

  • Stefan Brass
چکیده

It is by now folklore that the bottom-up evaluation of a program after the “magic set” transformation is “as efficient as” top-down evaluation. There are a number of formalizations of this in the literature. However, the naive formalization is false: As shown by Ross, SLD-resolution can be much more efficient than bottom-up evaluation with magic sets on tail-recursive programs. We show that this happens only for tail-recursive programs, and that the only problem of magic sets is the materialization of “lemmas”. So magic sets are always “as goal-directed as” SLD-resolution. These results are not surprising, but we believe that the variants given here are especially useful for teaching purposes. We also give rather simple proofs. Furthermore, we demonstrate that SLD-resolution can be directly simulated by bottom-up evaluable programs if all recursions are tailrecursive. This is based on the meta-interpreter approach of Bry and seems to be very promising.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

SLDMagic | An Improved Magic Set Technique

We present a rewriting method for Datalog-programs which simulates SLD-resolution more closely than the ordinary \magic set" method does. This is especially advantageous in the case of tail-recursive programs, but already in non-recursive programs we can often save a number of joins. In contrast to the method of Ross 7], we do not only solve the problem of tail-recursion, but try to simulate SL...

متن کامل

SDLMagic - An Improved Magic Set Technique

We present a rewriting method for Datalog-programs which simulates SLD-resolution more closely than the ordinary “magic set” method does. This is especially advantageous in the case of tail-recursive programs, but already in nonrecursive programs we can often save a number of joins. In contrast to the method of ROSS [7], we do not only solve the problem of tail-recursion, but try to simulate SL...

متن کامل

The Underlying Search for Magic Templates and Tabulation

The main aim of this paper is to present a framework for tabulated SLD-resolution that allows a strict separation between search space and search. We introduce the notion of a search forest to model the search space, and we deene what we understand by a search strategy for it. We present some basic search strategies and discuss how a particular tabulation technique, OLDT-resolution, and a parti...

متن کامل

The magic of logical inference in probabilistic programming

Today, many different probabilistic programming languages exist and even more inference mechanisms for these languages. Still, most logic programming based languages use backward reasoning based on SLD resolution for inference. While these methods are typically computationally efficient, they often can neither handle infinite and/or continuous distributions, nor evidence. To overcome these limi...

متن کامل

Modal logic programming revisited

We present optimizations for the modal logic programming system MProlog, including the standard form for resolution cycles, optimized sets of rules used as meta-clauses, optimizations for the version of MProlog without existential modal operators, as well as iterative deepening search and tabulation. Our SLD-resolution calculi for MProlog in a number of modal logics are still strongly complete ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1995